package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarCustomerAddressMapper;
import com.ruoyi.system.domain.CarCustomerAddress;
import com.ruoyi.system.service.ICarCustomerAddressService;

/**
 * 客户地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-10
 */
@Service
public class CarCustomerAddressServiceImpl implements ICarCustomerAddressService 
{
    @Autowired
    private CarCustomerAddressMapper carCustomerAddressMapper;

    /**
     * 查询客户地址
     * 
     * @param id 客户地址主键
     * @return 客户地址
     */
    @Override
    public CarCustomerAddress selectCarCustomerAddressById(Long id)
    {
        return carCustomerAddressMapper.selectCarCustomerAddressById(id);
    }

    /**
     * 查询客户地址列表
     * 
     * @param carCustomerAddress 客户地址
     * @return 客户地址
     */
    @Override
    public List<CarCustomerAddress> selectCarCustomerAddressList(CarCustomerAddress carCustomerAddress)
    {
        return carCustomerAddressMapper.selectCarCustomerAddressList(carCustomerAddress);
    }

    /**
     * 新增客户地址
     * 
     * @param carCustomerAddress 客户地址
     * @return 结果
     */
    @Override
    public int insertCarCustomerAddress(CarCustomerAddress carCustomerAddress)
    {
        carCustomerAddress.setCreateTime(DateUtils.getNowDate());
        return carCustomerAddressMapper.insertCarCustomerAddress(carCustomerAddress);
    }

    /**
     * 修改客户地址
     * 
     * @param carCustomerAddress 客户地址
     * @return 结果
     */
    @Override
    public int updateCarCustomerAddress(CarCustomerAddress carCustomerAddress)
    {
        carCustomerAddress.setUpdateTime(DateUtils.getNowDate());
        return carCustomerAddressMapper.updateCarCustomerAddress(carCustomerAddress);
    }

    /**
     * 批量删除客户地址
     * 
     * @param ids 需要删除的客户地址主键
     * @return 结果
     */
    @Override
    public int deleteCarCustomerAddressByIds(Long[] ids)
    {
        return carCustomerAddressMapper.deleteCarCustomerAddressByIds(ids);
    }

    /**
     * 删除客户地址信息
     * 
     * @param id 客户地址主键
     * @return 结果
     */
    @Override
    public int deleteCarCustomerAddressById(Long id)
    {
        return carCustomerAddressMapper.deleteCarCustomerAddressById(id);
    }
}
